<script setup>
import { ref, onMounted } from 'vue'
import { useUserStore } from '@/stores/index'
import { getCageInfo } from '@/api/news'
const userStore = useUserStore()
console.log('userStore', userStore)
const tokenInput = ref('')
onMounted(async () => {
  const res = await getCageInfo()
  console.log(res)
})
</script>

<template>
  <div>
    <h1>this is demo view</h1>
    <div>{{ userStore.token }}</div>
    <el-button @click="userStore.removeToken">清除token</el-button>
    <div>
      <el-input style="width: 160px" v-model="tokenInput">123</el-input>
      <button @click="userStore.setToken(tokenInput)">设置token</button>
    </div>
  </div>
</template>

<style lang="less" scoped></style>
